/* ***********************
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is CreateSkeleton.js module.
 *
 * The Initial Developer of the Original Code is Rob Gerns.
 *
 * Portions created by the Initial Developer are Copyright (C) 2010
 * the Initial Developer. All Rights Reserved.
 *
 **************************/

/***************************************************
* Function Name:  createSkeleton 
*
* Purpose:
* Write a few layers to later sort features/ads by priority level
* This has to be done here, before anything is done with the returned XML data
* in order for it to work in all browsers
****************************************************/

function createSkeleton(){
   
	
 //Create an overall div cotainer called 'container'
 divContainer = document.createElement("div");
 divContainerId = divContainer.id = "container";
 document.body.appendChild(divContainer);


 //This div is used as a starting point for the ads and priority divs
 divBegin = document.createElement("div");
 divBeginId = divBegin.id = "begin";
 divContainer.appendChild(divBegin);

 //Ad number 1 div - note that all of these divs are created regardless of what the XML contains, we'll hide 'em later if necessary
 divAd = document.createElement("div");
 divAdId = divAd.id = "advertisement1";
 divAd.className = "advertisement";
 divContainer.appendChild(divAd);

 //Ad number 2 div
 divAd2 = document.createElement("div");
 divAd2Id = divAd2.id = "advertisement2";
 divAd2.className = "advertisement";
 divContainer.appendChild(divAd2);

 //Ad number 3 div - if there are more than 3 ads, the XML is breaking away from the schema
 divAd3 = document.createElement("div");
 divAd3Id = divAd3.id = "advertisement3";
 divAd3.className = "advertisement";
 divContainer.appendChild(divAd3);

 //Div for any 'Highest' priority features goes at the top, but after the ads
 divHighest = document.createElement("div");
 divHighestId = divHighest.id = "highest";
 divContainer.appendChild(divHighest);

 //Div for 'High' priority is next
 divHigh = document.createElement("div");
 divHighId = divHigh.id = "high";
 divContainer.appendChild(divHigh);

 //Div for 'Normal' priority should be after 'Highest' and 'High'
 divNormal = document.createElement("div");
 divNormalId = divNormal.id = "normal";
 divContainer.appendChild(divNormal);

 //Div for 'Low' priority should be after 'Highest', 'High' and 'Normal'
 divLow = document.createElement("div");
 divLowId = divLow.id = "low";
 divContainer.appendChild(divLow);

 //Div for 'Lowest' priority should be after every other priority
 divLowest = document.createElement("div");
 divLowestId = divLowest.id = "lowest";
 divContainer.appendChild(divLowest);
	
}